/**
 * @param {string} s
 * @param {string} t
 * @return {boolean}
 */
var isSubsequence = function(s, t) {
    let sArr = s.split(''), tArr = t.split('');
    let i = 0, j = 0;
    if(sArr.length === 0) return true
    while(i < sArr.length && j < tArr.length) {
        if(sArr[i] === tArr[j]) {
            if(i === sArr.length - 1) {
                return true
            }
            i++;
            j++;
        } else {
            j++
        }
    }
    return false;
};
console.log(isSubsequence('abc', "ahbgdc"));
console.log(isSubsequence("axc", "ahbgdc"));